package main

import "fmt"

type Student struct {
	name string
	age int
}
func main() {
	var list = make([]interface{}, 3)
	list[0] = 1
	list[1] = "1"
	list[2] = Student{"mike", 22}

	for i,item := range list {
		if v,ok := item.(int); ok {
			fmt.Printf("list[%d] is int, value is %d\n", i, v)
		} else if v,ok := item.(string); ok {
			fmt.Printf("list[%d] is string, value is %s\n", i, v)
		} else if v,ok := item.(Student); ok {
			fmt.Printf("list[%d] is Student, value is %+v\n",i, v)
		}
	}
}
